<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <meta name="renderer" content="webkit">
    <title>Docker自动化部署平台</title>
    <link rel="stylesheet" href="http://cdn.bootcss.com/materialize/0.97.0/css/materialize.min.css">
    <link href="/css/icon.css" rel="stylesheet">
    <script src="http://cdn.bootcss.com/jquery/2.1.4/jquery.min.js"></script>
    <script src="http://cdn.bootcss.com/materialize/0.97.0/js/materialize.min.js"></script>
    <script src="/js/deploy/new.js"></script>
</head>
<body style="font-family: 'Roboto', 'Droid Sans Fallback', '微软雅黑'; min-height: 100vh;display: flex;flex-direction: column;">

<nav>
    <div class="nav-wrapper">
        <a href="/" class="brand-logo center">Docker自动化部署平台</a>
        <ul class="left hide-on-med-and-down">
            <li><a href="/">首页</a></li>
        </ul>
    </div>
</nav>

<form id="form-new" method="post" action="/deploy/insert" style="flex: 1 0 auto;">
    <div class="container" style="padding-top: 20px;">

        <div class="row">
            <div class="col s12">
                <div class="card">
                    <div class="card-content">
                        <span class="card-title black-text">项目描述</span>

                        <div class="row">
                            <#if detail??>
                                <input type="hidden" id="input-name" name="uuid" value="${detail.uuid}">
                                <div class="input-field col s12">
                                    <input type="text" id="input-name" name="name" value="${detail.name}">
                                    <label for="input-name">项目名称</label>
                                </div>
                                <div class="input-field col s4">
                                    <input type="text" id="input-dockerFileName" name="dockerFileName"
                                           value="${detail.dockerFileName}">
                                    <label for="input-profile">Dockerfile 名字</label>
                                </div>
                                <div class="input-field col s4">
                                    <input type="text" id="input-dockerFilePath" name="dockerFilePath"
                                           value="${detail.dockerFilePath}">
                                    <label for="input-module">Dockerfile 路径（绝对路径请使用 abs:/data/xxx/）</label>
                                </div>
                                <div class="input-field col s4">
                                    <input type="text" id="input-imageTag" name="imageTag"
                                           value="${detail.imageTag}">
                                    <label for="input-module">Image Tag(xxxx:latest) </label>
                                </div>
                                <div class="input-field col s6">
                                    <input type="text" id="input-volume" name="volume"
                                           value="<#if detail.volume??>${detail.volume} </#if>">
                                    <label for="input-url">路径映射 主机地址:容器地址
                                        如：/data/log:/var/log1,/data/log:/var/log2</label>
                                </div>

                                <div class="input-field col s6">
                                    <input type="text" id="input-ports" name="ports" value="${detail.ports}">
                                    <label for="input-url">端口映射 主机端口:容器端口 如：9090:9090,8080,8080</label>
                                </div>

                                <div class="input-field col s6">
                                    <input type="text" id="input-url" name="url" value="${detail.url}">
                                    <label for="input-url">GIT地址</label>
                                </div>
                                <div class="input-field col s6 input-field-branch">
                                    <input type="text" id="input-branch" name="branch"
                                           value="${detail.branch}">
                                    <label for="input-branch">Git分支</label>
                                </div>
                                <div class="input-field col s6">
                                    <input type="text" id="input-userName" name="userName"
                                           value="${detail.userName}">
                                    <label for="input-url">GIT用户名</label>
                                </div>
                                <div class="input-field col s6 input-field-branch">
                                    <input type="text" id="input-password" name="password"
                                           value="${detail.password}">
                                    <label for="input-branch">GIT密码</label>
                                </div>
                                　　              <#else>
                                <div class="input-field col s12">
                                    <input type="text" id="input-name" name="name">
                                    <label for="input-name">项目名称</label>
                                </div>
                                <div class="input-field col s4">
                                    <input type="text" id="input-dockerFileName" name="dockerFileName">
                                    <label for="input-profile">Dockerfile 名字</label>
                                </div>
                                <div class="input-field col s4">
                                    <input type="text" id="input-dockerFilePath" name="dockerFilePath">
                                    <label for="input-module">Dockerfile 路径（绝对路径请使用 abs:/data/xxx/）</label>
                                </div>
                                <div class="input-field col s4">
                                    <input type="text" id="input-imageTag" name="imageTag">
                                    <label for="input-module">Image Tag(xxxx:latest) </label>
                                </div>

                                <div class="input-field col s6">
                                    <input type="text" id="input-volume" name="volume">
                                    <label for="input-url">路径映射 主机地址:容器地址
                                        如：/data/log:/var/log1,/data/log:/var/log2</label>
                                </div>

                                <div class="input-field col s6">
                                    <input type="text" id="input-ports" name="ports">
                                    <label for="input-url">端口映射 主机端口:容器端口 如：9090:9090,8080,8080</label>
                                </div>

                                <div class="input-field col s6">
                                    <input type="text" id="input-url" name="url">
                                    <label for="input-url">GIT地址</label>
                                </div>
                                <div class="input-field col s6 input-field-branch">
                                    <input type="text" id="input-branch" name="branch">
                                    <label for="input-branch">Git分支</label>
                                </div>
                                <div class="input-field col s6">
                                    <input type="text" id="input-userName" name="userName">
                                    <label for="input-url">GIT用户名</label>
                                </div>
                                <div class="input-field col s6 input-field-branch">
                                    <input type="text" id="input-password" name="password">
                                    <label for="input-branch">GIT密码</label>
                                </div>
                            </#if>

                        </div>
                    </div>
                    <div class="card-action">
                        <p>
                            <button type="submit" class="btn waves-light waves-effect white-text">提交</button>
                        </p>
                    </div>
                </div>
            </div>
        </div>

    </div>
</form>

<div id="alert-modal" class="modal">
    <div class="modal-content">
        <p class="grey-text">提示</p>
        <p class="text-alert"></p>
    </div>
    <div class="modal-footer">
        <a href="#" class="modal-action modal-close waves-effect waves-green btn-flat">关闭</a>
    </div>
</div>

</body>
</html>